<h2><?php pc_echo(pc_message("register.title")); ?></h2>
<?php pc_pagelet("common/errors");
$errors = pc_variable("errors"); ?>
<form method="post" action="dispatcher.php">
    <fieldset class="distinct">
        <legend><?php pc_echo(pc_message("register.contactInfo")); ?></legend>
        <span class="required">
            <label for="register.contactName" class="required"><?php pc_echo(pc_message("field.contactName")); ?></label>
            <input type="text" id="register.contactName" name="contactName" value="<?php pc_echo(pc_variable("contactName")); ?>"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "contactName")); ?>
        <span class="required">
            <label for="register.emailAddress" class="required"><?php pc_echo(pc_message("field.emailAddress")); ?></label>
            <input type="text" id="register.emailAddress" name="emailAddress" value="<?php pc_echo(pc_variable("emailAddress")); ?>"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "emailAddress")); ?>
        <label for="register.phoneNumber"><?php pc_echo(pc_message("field.phoneNumber")); ?></label>
        <input type="text" id="register.phoneNumber" name="phoneNumber" value="<?php pc_echo(pc_variable("phoneNumber")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "phoneNumber")); ?>
        <label for="register.faxNumber"><?php pc_echo(pc_message("field.faxNumber")); ?></label>
        <input type="text" id="register.faxNumber" name="faxNumber" value="<?php pc_echo(pc_variable("faxNumber")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "faxNumber")); ?>
        <label for="register.mobileNumber"><?php pc_echo(pc_message("field.mobileNumber")); ?></label>
        <input type="text" id="register.mobileNumber" name="mobileNumber" value="<?php pc_echo(pc_variable("mobileNumber")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "mobileNumber")); ?>
    </fieldset>
    <fieldset class="distinct">
        <legend><?php pc_echo(pc_message("register.accountInfo")); ?></legend>
        <span class="required">
            <label for="register.username" class="required"><?php pc_echo(pc_message("field.username")); ?></label>
            <input type="text" id="register.username" name="username" value="<?php pc_echo(pc_variable("username")); ?>"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "username")); ?>
        <span class="required">
            <label for="register.password" class="required"><?php pc_echo(pc_message("field.password")); ?></label>
            <input type="password" id="register.password" name="password"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "password")); ?>
        <span class="required">
            <label for="register.repeatPassword" class="required"><?php pc_echo(pc_message("field.repeatPassword")); ?></label>
            <input type="password" id="register.repeatPassword" name="repeatPassword"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "repeatPassword")); ?>
    </fieldset>
    <fieldset class="distinct">
        <legend><?php pc_echo(pc_message("register.address")); ?></legend>
        <span class="required">
	        <label for="register.address.line1"><?php pc_echo(pc_message("field.address.line1")); ?></label>
	        <input type="text" id="register.address.line1" name="address.line1" value="<?php pc_echo(pc_variable("address.line1")); ?>"/>
	    </span>
	    <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "address.line1")); ?>
        <label for="register.address.line2"><?php pc_echo(pc_message("field.address.line2")); ?></label>
        <input type="text" id="register.address.line2" name="address.line2" value="<?php pc_echo(pc_variable("address.line2")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "address.line2")); ?>
        <span class="required">
	        <label for="register.address.postalCode"><?php pc_echo(pc_message("field.address.postalCode")); ?></label>
	        <input type="text" id="register.address.postalCode" name="address.postalCode" value="<?php pc_echo(pc_variable("address.postalCode")); ?>"/>
	    </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "address.postalCode")); ?>
        <span class="required">
	        <label for="register.address.city"><?php pc_echo(pc_message("field.address.city")); ?></label>
	        <input type="text" id="register.address.city" name="address.city" value="<?php pc_echo(pc_variable("address.city")); ?>"/>
	    </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "address.city")); ?>
    </fieldset>
    <fieldset class="distinct">
        <legend><?php pc_echo(pc_message("register.companyInfo")); ?></legend>
        <label for="register.companyName"><?php pc_echo(pc_message("field.companyName")); ?></label>
        <input type="text" id="register.companyName" name="companyName" value="<?php pc_echo(pc_variable("companyName")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "companyName")); ?>
        <label for="register.vatCode"><?php pc_echo(pc_message("field.vatCode")); ?></label>
        <input type="text" id="register.vatCode" name="vatCode" value="<?php pc_echo(pc_variable("vatCode")); ?>"/>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "vatCode")); ?>
    </fieldset>
    <div class="buttons">
        <input type="hidden" name="referringPage.location" value="<?php pc_echo(pc_variable("currentPage.location")); ?>"/>
        <input type="hidden" name="referringPage.name" value="<?php pc_echo(pc_message("register.title")); ?>"/>
        <input type="hidden" name="targetPage.location" value="<?php pc_echo(pc_variable("targetPage.location")); ?>"/>
        <button type="submit" name="controller" value="Commerce/RegisterCustomer" class="register"><?php pc_echo(pc_message("register.submit")); ?></button>
    </div>
</form>